package com.itheima.dao;

import com.itheima.domain.Student;
import com.itheima.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface UserDao {
    @Select("select username,password from user where username=#{username} and password=#{password}")
    User login(User user);

    @Insert("insert into student(name,age) values(#{name},#{age})")
    Integer addStudent(Student student);

    @Delete("delete from student where id=#{id}")
    Integer deleteStudent(String id);

    @Update("update student set name=#{name},age=#{age} where id=#{id}")
    Integer updateStudent(Student student);
}
